🖥Необходимо определить делегат и реализовать метод
⏩Итак, вот задание: определить делегат bool CounterHashSetDelegate(int a) и реализовать метод int Function12(HashSet<int> intSet, CounterHashSetDelegate filter), который возвращает количество элементов из intSet, которые удовлетворяют условию filter.
public static class { public delegate bool CounterHashSetDelegate(int a); public static int Function12(HashSet<int> intSet, CounterHashSetDelegate filter) {
int count = 0; foreach (int i in intSet) { if(filter(i)) count++; } return count; } }
⏩Давайте сразу к сути, решение может выглядеть так:
public delegate bool CounterHashSetDelegate(int a);
class Program { static void Main(string[] args) { CounterHashSetDelegate d = IsEvenNum;
🖥Необходимо определить делегат и реализовать метод
⏩Итак, вот задание: определить делегат bool CounterHashSetDelegate(int a) и реализовать метод int Function12(HashSet<int> intSet, CounterHashSetDelegate filter), который возвращает количество элементов из intSet, которые удовлетворяют условию filter.
public static class { public delegate bool CounterHashSetDelegate(int a); public static int Function12(HashSet<int> intSet, CounterHashSetDelegate filter) {
int count = 0; foreach (int i in intSet) { if(filter(i)) count++; } return count; } }
⏩Давайте сразу к сути, решение может выглядеть так:
public delegate bool CounterHashSetDelegate(int a);
class Program { static void Main(string[] args) { CounterHashSetDelegate d = IsEvenNum;
In many cases, the content resembled that of the marketplaces found on the dark web, a group of hidden websites that are popular among hackers and accessed using specific anonymising software.“We have recently been witnessing a 100 per cent-plus rise in Telegram usage by cybercriminals,” said Tal Samra, cyber threat analyst at Cyberint.The rise in nefarious activity comes as users flocked to the encrypted chat app earlier this year after changes to the privacy policy of Facebook-owned rival WhatsApp prompted many to seek out alternatives.
Traders also expressed uncertainty about the situation with China Evergrande, as the indebted property company has not provided clarification about a key interest payment.In economic news, the Commerce Department reported an unexpected increase in U.S. new home sales in August.Crude oil prices climbed Friday and front-month WTI oil futures contracts saw gains for a fifth straight week amid tighter supplies. West Texas Intermediate Crude oil futures for November rose $0.68 or 0.9 percent at 73.98 a barrel. WTI Crude futures gained 2.8 percent for the week.